package com.kun.ble;

import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.pm.PackageManager;

import com.kun.myproject.R;
import com.kun.utils.ToastUtil;


/**
 * Created by 荣坤 on 2015/12/6.
 */
public class BleInit {
    public boolean BleInit(Context ct, BluetoothAdapter myBluetoothAdapter){
        if (!ct.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
            ToastUtil.toastShort(ct, R.string.ble_not_supported);
            return false;
        }
        if(myBluetoothAdapter == null){
            ToastUtil.toastShort(ct, R.string.error_bluetooth_not_supported);
            return false;
        }
//        if(!myBluetoothAdapter.isEnabled()){
//            Intent enableIntent = new Intent(
//                    BluetoothAdapter.ACTION_REQUEST_ENABLE);
//            ct.startActivity(enableIntent);
//        }
        return true;
    }
}
